<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

/**
 * 卡券转赠记录模型
 * @package App\Models
 */
class WxCardTransfer extends Model
{
    use SoftDeletes;
    protected $table = 'wx_card_transfers';
    //主键
    protected $primaryKey = 'id';
    protected $dateFormat = 'Y-m-d H:i:s';
    /**
     * 需要转换成日期的属性
     * @var array
     */
    protected $dates = [

    ];
    /**
     * 应该被转换成原生类型的属性。
     * @var array
     */
    protected $casts = [
    ];
    /**
     * 微信用户数据模型关联
     * @return \Illuminate\Database\Eloquent\Relations\HasOne
     */
    public function user()
    {
        return $this->hasOne('App\Models\WxUser','openid', 'user_openid');
    }
}
